{extend name="public/base"/}
{block name="style"}
<link rel="stylesheet" href="__PUBLIC__/admin/index/css/index.css?v=20221110&times={:time()}" />
<link rel="stylesheet" href="__PUBLIC__/admin/material/css/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/static/layui/css/layui.css" />
{include file="material/_ali_icon" /}

{/block}
{block name="body"}

<div class="main-box no-header">
	<div class="head_content">

		<div>
			<h1>
				<img style="width: 350px;" src="__PUBLIC__/images/title.png" alt="">
				<button type="button" class="btn btn-primary btn-sm">
					企业介绍
				</button>
			</h1>
			<p class="introduce">宝剑锋从磨砺出<br>
			</p>
			<p class="tip">
				<i>善良</i>
				<i>诚信</i>
				<i>拼搏</i>
				<i>平等</i>
				让每一次努力都被尊重
			</p>
		</div>
		<div style="height:20px;font-size: 20px;background-color: #d5c3b4;"></div>
		<div class="message" style="line-height: 27px;position: relative;">
			<!-- <div class="row aNotice" style="height:235px;"> -->
			<div class="row aNotice layui-carousel" id="messagelist" style="width: 100%;">
				<div  carousel-item="" >
				{empty name="messagelist"}
				<div style="text-align: center">
					<p>暂无内容</p>
				</div>
				{/empty}
				{volist name="messagelist" id="vo"}
				<div class="col-md-12 notice">
					<div style="width: 100%;padding:15px 20px;">
						<div style="display: flex; flex-direction: row; ">
							<span class="red">{$vo.title}：</span>
							<div>
								{$vo.content}
							</div>
						</div>
						<span class="info_time" style="margin-top: 40px;">发送时间：{$vo.send_date}，发送人：{$vo.sender}</span>
				</div>
				</div>
				{/volist}
			</div>
			</div>
			<button type="button" class="btn btn-info more" style="bottom:20px;margin-right: 100px;"  id="seemore">
				过往通知
			</button>
			<button type="button" class="btn btn-primary more" style="bottom:20px; margin-right: 20px;"  id="createUrl">
				发通知
			</button>
			<div class="modal fade" id="create-referral-link-modal">
				<div class="modal-dialog" role="document">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
									aria-hidden="true">×</span></button>
							<span style="font-size: 20px;"><span id="referralname">发通知</span></span>
						</div>
						<div class="modal-body">
							<div data-bind="visible: loading" class="loading-panel" style="display: none;">
								<i class="fa fa-spin fa-spinner"></i>
							</div>
							<form class="form-horizontal modelform">
								<div class="row">
									<div class="col-md-10">
										<div class="form-group">
											<label class="control-label col-sm-3">标题</label>
											<div class="col-lg-9">
												<input type="text" class="form-control" name="title" placeholder="请输入标题">
											</div>
										</div>
									</div>
								</div>
								<div class="row">
									<div class="col-md-10">
										<div class="form-group">
											<label class="control-label col-sm-3">内容</label>
											<div class="col-lg-9 col-sm-9">
												<textarea class="form-control" name="content" placeholder="请输入内容" ></textarea>
											</div>
										</div>
									</div>
								</div>
								<div class="row">
									<div class="col-md-10">
										<div class="form-group">
											<label class="control-label col-sm-3">接收组</label>
											<div class="col-lg-9">
												<select name="recipient" id="operateSelect"  data-live-search="true" class="form-control"  style="width:100%;">
													<option value="999">所有人</option>
													{foreach name="groupList" item="vo" key="k" }
													<option value="{$k}">{$vo}</option>
													{/foreach}
												</select>
											</div>
										</div>
									</div>
								</div>
								<input type="hidden" name="id">
							</form>
						</div>
						<div class="modal-footer">
							<button type="button" id="addMessage" class="btn btn-primary ">提交</button>
						</div>
					</div>
				</div>
			</div>

		</div>
		<div class="datas">
			<div style="padding: 10px 170px;font-size: 20px;">
				个人信息
			</div>
			<div class="message intro">
				<div class="row">
					<div class="col-md-3">
						姓名：<span>{$userInfo.username}</span>
					</div>
					<div class="col-md-3">
						性别：<span>{$userInfo.sex_text}</span>
					</div>
					<div class="col-md-3">
						年龄：<span>{$userInfo.birthday_text}</span>
					</div>
					<div class="col-md-3">
						学历：<span>{$userInfo.schooling_text}</span>
					</div>
				</div>
				<div class="row">
					<div class="col-md-3">
						岗位：<span>{$userInfo.situation_text}</span>
					</div>
					<div class="col-md-3">
						职级：<span>{$userInfo.gradation_text}</span>
					</div>
					<div class="col-md-3">
						部门：<span>{$userInfo.group_text}</span>
					</div>
					<div class="col-md-3">
						状态：<span>{$userInfo.job_status_text}</span>
					</div>
				</div>
				<div class="row" style="margin-top: 30px;">
					<div class="col-md-3">
						入职时间：<span>{$userInfo.reg_time_text}</span>
					</div>
				</div>
				<div class="row">
					<div class="col-md-6">
						擅&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;长：<span>{$userInfo.hobby}</span>
					</div>
				</div>
				<div class="row">
					<div class="col-md-6">
						其他技能：<span>{$userInfo.other_skills}</span>
					</div>
				</div>
				<div class="row" style="margin-top: 30px;">
					<div class="col-md-12" style="min-height: 100px;display: flex;">
						表彰墙：
						<div>
							{foreach name="userInfo.honour_text" item="vo" key="k"}
							<p>时间：{$vo.honour_time_text} 标题：{$vo.honour_title} 内容：{$vo.honour_content}</p>
							{/foreach}
						</div>
					</div>
				</div>
			</div>
			<button type="button" class="btn btn-primary more" id="more_data">
				更多资料 
			</button>
		</div>
	</div>
	<div class="allTable">
		<div class="aTable">
			<div style="background: #f3f5f6;">
				<div class="head_title">
					公司资料
				</div>
				<div class="body_content">
					<div class="row" style="width: 100%;">
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>考勤表</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn" style="background:#009688;">
								<span style="color: #ddd;">月度考评表</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn" style="background:#009688;">
								<span style="color: #ddd;">岗位确认书</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>过往业绩单</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn {$userInfo.group==999?'handbook':'handbook2'}">
								<span>员工手册</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>办公室管理制度</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>考勤表</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>月度考评表</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>岗位确认书</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>过往业绩单</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn  {$userInfo.group==999?'handbook':'handbook2'}">
								<span>员工手册</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>办公室管理制度</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>办公室管理制度</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>考勤表</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>月度考评表</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>岗位确认书</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn">
								<span>过往业绩单</span>
							</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary addBtn {$userInfo.group==999?'handbook':'handbook2'}">
								<span>员工手册</span>
							</button>
						</div>

					</div>
				</div>

			</div>
		</div>

	</div>

	<div  class="datas" id="mobanlist" style="display: none;">
		<div class="message " style="margin: 10px auto;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			font-size: 16px;">
			<div class="row" style="margin-top: 10px;width: 90%;">
				<div class="col-md-3">
					姓名：<span>{$userInfo.username}</span>
				</div>
				<div class="col-md-3">
					性别：<span>{$userInfo.sex_text}</span>
				</div>
				<div class="col-md-3">
					年龄：<span>{$userInfo.birthday_text}</span>
				</div>
				<div class="col-md-3">
					学历：<span>{$userInfo.schooling_text}</span>
				</div>
			</div>
			<div class="row" style="margin-top: 10px;width: 90%;">
				<div class="col-md-3">
					岗位：<span>{$userInfo.situation_text}</span>
				</div>
				<div class="col-md-3">
					职级：<span>{$userInfo.gradation_text}</span>
				</div>
				<div class="col-md-3">
					部门：<span>{$userInfo.group_text}</span>
				</div>
				<div class="col-md-3">
					状态：<span>{$userInfo.job_status_text}</span>
				</div>
			</div>
			<div class="row" style="margin-top: 10px;width: 90%;">
				<div class="col-md-3">
					电话：<span>{$userInfo.mobile!=0??'未填写'}</span>
				</div>
				<div class="col-md-3">
					省市区：<span>{$userInfo.province}-{$userInfo.city}-{$userInfo.area}</span>
				</div>
				<div class="col-md-3">
					地址：<span>{$userInfo.address}</span>
				</div>
			</div>
			<div class="row" style="margin-top: 30px;width: 90%;">
				<div class="col-md-3">
				最后登录时间: <span>{$userInfo.last_login_time_text}</span>
				</div>
			</div>
			<div class="row" style="margin-top: 10px;width: 90%;">
				<div class="col-md-3">
				最后登录ip：<span>{$userInfo.last_login_ip_text}</span>
				</div>
			</div>
			<div class="row" style="margin-top: 30px;width: 90%;">
				<div class="col-md-3">
					生日日期：<span>{$userInfo.birthday}</span>
				</div>
			</div>
			<div class="row" style="margin-top: 30px;width: 90%;">
				<div class="col-md-3">
					入职时间：<span>{$userInfo.reg_time_text}</span>
				</div>
			</div>
			<div class="row"style="margin-top: 10px;width: 90%;">
				<div class="col-md-6">
					擅&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;长：<span>{$userInfo.hobby}</span>
				</div>
			</div>
			<div class="row" style="margin-top: 10px;width: 90%;">
				<div class="col-md-6">
					其他技能：<span>{$userInfo.other_skills}</span>
				</div>
			</div>
			<div class="row" style="margin-top: 30px;width: 90%;">
				<div class="col-md-12" style="min-height: 100px;display: flex;">
					表彰墙：
					<div>
						{foreach name="userInfo.honour_text" item="vo" key="k"}
						<p>时间：{$vo.honour_time_text} 标题：{$vo.honour_title} 内容：{$vo.honour_content}</p>
						{/foreach}
					</div>
				</div>
			</div>
		</div>
	</div>
	<div id="msgtimeline" style="display: none;">
	<ul class="layui-timeline" style="margin: 20px;">
		{volist name="message" id="vo"}
		<li class="layui-timeline-item">
			<i class="layui-icon layui-timeline-axis"></i>
			<div class="layui-timeline-content layui-text">
			  <h3 class="layui-timeline-title" style="border-bottom: 0px;">{$vo.send_date}</h3>
			  <p>
				<span class="red">{$vo.title}：</span>
				{$vo.content}
				<span class="info_time" style="margin-top: 60px;">发送人：{$vo.sender}</span>
			  </p>
			</div>
		  </li>
		{/volist}
	  </ul>
	</div>
	<div id="handbooklist" style="display: none;">
		<iframe frameborder="0" id="myIframe" scrolling="no" src="{$handbook.path_file}" width="100%" height="800px"></iframe>
	</div>
	<div id="addhandbook" style="display: none; ">
		<div class="layui-upload">
			<button type="button" class="layui-btn layui-btn-normal" id="testList">选择多文件</button> 
			<div class="layui-upload-list" style="max-width: 1000px;">
			  <table class="layui-table">
				<colgroup>
				  <col>
				  <col width="150">
				  <col width="260">
				  <col width="150">
				</colgroup>
				<thead>
				  <tr><th>文件名</th>
				  <th>大小</th>
				  <th>上传进度</th>
				  <th>操作</th>
				</tr></thead>
				<tbody id="demoList"></tbody>
			  </table>
			</div>
			<button type="button" class="layui-btn" id="testListAction">开始上传</button>
		  </div> 
		   
	</div>
	<script type="text/javascript" src="__PUBLIC__/plugs/layer/layer.js"></script>
	<script type="text/javascript" src="__PUBLIC__/plugs/bootstrap-select/js/bootstrap-select.js"></script>
	<script type="text/javascript" src="__PUBLIC__/static/layui/layui.js" ></script>
	<script type="text/javascript" src="__PUBLIC__/static/js/jquery.cookie.js"></script>
	<script type="text/javascript">
		layui.use(['carousel', 'form','upload', 'element', 'layer'], function(){
		var carousel = layui.carousel
		,form = layui.form;
		var $ = layui.jquery
		,upload = layui.upload
		,element = layui.element
		,layer = layui.layer;
		 //多文件列表
		 var uploadListIns = upload.render({
    elem: '#testList'
    ,elemList: $('#demoList') //列表元素对象
    ,url:"{:url('Upload/Uploadtxt')}" //此处用的是第三方的 http 请求演示，实际使用时改成您自己的上传接口即可。
    ,accept: 'file'
    ,multiple: true
    ,number: 1
    ,auto: false
    ,bindAction: '#testListAction'
    ,choose: function(obj){   
      var that = this;
      var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
      //读取本地文件
      obj.preview(function(index, file, result){
        var tr = $(['<tr id="upload-'+ index +'">'
          ,'<td>'+ file.name +'</td>'
          ,'<td>'+ (file.size/1014).toFixed(1) +'kb</td>'
          ,'<td><div class="layui-progress" lay-filter="progress-demo-'+ index +'"><div class="layui-progress-bar" lay-percent=""></div></div></td>'
          ,'<td>'
            ,'<button class="layui-btn layui-btn-xs demo-reload layui-hide">重传</button>'
            ,'<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
          ,'</td>'
        ,'</tr>'].join(''));
        
        //单个重传
        tr.find('.demo-reload').on('click', function(){
          obj.upload(index, file);
        });
        
        //删除
        tr.find('.demo-delete').on('click', function(){
          delete files[index]; //删除对应的文件
          tr.remove();
          uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值，以免删除后出现同名文件不可选
        });
        
        that.elemList.append(tr);
        element.render('progress'); //渲染新加的进度条组件
      });
    }
    ,done: function(res, index, upload){ //成功的回调
		console.log(res);
					//获取参数
						$.ajax({
						type: "POST",
						url: "{:url('index/IndexUpload')}",
						data: {'path_name':res.info.name,'path_file':res.info.path,'type':0},
						dataType: "json",
						success: function(data){
							if(data.code==1){
								layer.msg('添加成功',{icon:1,time:2000})
							}
						},
						error : function(e){
							console.log(e.status);
							console.log(e.responseText);
						}
					})
      var that = this;
      //if(res.code == 0){ //上传成功
        var tr = that.elemList.find('tr#upload-'+ index)
        ,tds = tr.children();
        tds.eq(3).html(''); //清空操作
        delete this.files[index]; //删除文件队列已经上传成功的文件
        return;
      //}
      this.error(index, upload);
    }
    ,allDone: function(obj){ //多文件上传完毕后的状态回调
      console.log(obj)
    }
    ,error: function(index, upload){ //错误回调
      var that = this;
      var tr = that.elemList.find('tr#upload-'+ index)
      ,tds = tr.children();
      tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
    }
    ,progress: function(n, elem, e, index){ //注意：index 参数为 layui 2.6.6 新增
      element.progress('progress-demo-'+ index, n + '%'); //执行进度条。n 即为返回的进度百分比
    }
  });
		 //设定各种参数
		 var ins3 = carousel.render({
			elem: '#messagelist',
			anim:'updown'
			,width: '100%'
			,height:'100px'
			,arrow:'none',
			indicator:'none',
			interval:3000,
			autoplay:true,
		});
	
	})
	</script>
	<script type="text/javascript">
		window.onload = function(){
			if($.cookie("isClose") != 'yes'){
				layer.open({
					type: 1,
					title: '通知',
					content:  $('#msgtimeline'),
					area:["30%","60%"],
					btn: ['确定'] //只是为了演示
					,yes: function(){
						// $.cookie("isClose",'yes',{ expires:1/8640});    //测试十秒
							$.cookie("isClose",'yes',{ expires:1});     //   一天
						layer.closeAll();
					}
				});
			}
		}
		var url;
		$('#createUrl').on('click', function () {
			$("#referralname").html("发通知");
			var $modal = $('#create-referral-link-modal');
			$modal.modal({backdrop: 'static', keyboard: false});
		});

		// 新增
		$("#addMessage").on('click',function(){
			url = "{:url('addMessage')}"
			var data = $('.modelform').serializeJson();
			if ( data['title'] == undefined) {
				updateAlert("标题不能为空", 'danger');
				return false;
			}

			if (data['content'] == '') {
				updateAlert("内容不能为空", 'danger');
				return false;
			}
			console.log(data)
			$.ajax({
				type: "POST",
				url: url,
				data:data,
				dataType: "json",
				success: function(data){
					if(data.code==1){
						updateAlert(data.msg, 'success');
						setTimeout(function() {
							window.location.reload();
						}, 100);
					}else{
						updateAlert("添加，"+data.msg, 'danger');
					}
				},
				error : function(e){
					console.log(e.status);
					console.log(e.responseText);
				}
			})
		});
		$("#more_data").on('click',function(){
			layer.open({
			type: 1,
            title: '更多资料',
            content:  $('#mobanlist'),
			area:["50%","60%"],
			btn: ['确定'] //只是为了演示
			,yes: function(){
				layer.closeAll();
			}
        });
		})
		$("#seemore").on('click',function(){
			layer.open({
			type: 1,
            title: '过往通知',
            content:  $('#msgtimeline'),
			area:["30%","60%"],
			btn: ['确定'] //只是为了演示
			,yes: function(){
				layer.closeAll();
			}
        });
		})
		$(".handbook").on('click',function(){
		
			layer.open({
			type: 1,
            title: '员工手册',
            content:  $('#handbooklist'),
			area:["70%","80%"],
			btn: ['确定','上传'] //只是为了演示
			,yes: function(){
				layer.closeAll();
			}
			,btn2:function(){
				layer.open({
					type: 1,
					title: '上传员工手册',
					content:  $('#addhandbook'),
					area:["60%","60%"],
					btn: ['确定'] //只是为了演示
					,yes: function(){
			
					layer.closeAll();
					}
				});
				}
        	});
		})
		$(".handbook2").on('click',function(){
		layer.open({
		type: 1,
		title: '员工手册',
		content:  $('#handbooklist'),
		area:["70%","80%"],
		btn: ['确定'] //只是为了演示
		,yes: function(){
			layer.closeAll();
		}
		});
	})
	</script>

</div>
{/block}